﻿using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using WebApiClientCore.Attributes;
using XUCore.WeChat.Apis;

namespace XUCore.WeChat.Enterprise.Apis.Group.Chat
{
    /// <summary>
    /// https://developer.work.weixin.qq.com/document/path/92120
    /// </summary>
    [HttpHost("https://qyapi.weixin.qq.com/cgi-bin/")]
    public interface IEnterpriseGroupChatApi : IEnterpriseWeChatApiWithAccessTokenFilter
    {
        // /// <summary>
        // /// 获取客户群列表<para/>
        // /// 
        // /// 该接口用于获取配置过客户群管理的客户群列表。<para/>
        // /// <see url="https://developer.work.weixin.qq.com/document/path/92120"/>
        // /// </summary>
        // /// <param name="access_token">调用接口凭证</param>
        // /// <param name="input"></param>
        // /// <returns></returns>
        // [HttpPost("externalcontact/groupchat/list")]
        // Task<ChatApiResult> GetListAsync([Required] string access_token, [JsonNetContent(CharSet = "utf-8")] QueryChatInput input);
        /// <summary>
        /// 获取客户群列表<para/>
        /// 
        /// 该接口用于获取配置过客户群管理的客户群列表。<para/>
        /// <see url="https://developer.work.weixin.qq.com/document/path/92120"/>
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("externalcontact/groupchat/list")]
        Task<ChatApiResult> GetListAsync([JsonNetContent(CharSet = "utf-8")] QueryChatInput input);
        // /// <summary>
        // /// 获取客户群详情<para/>
        // /// 
        // /// 通过客户群ID，获取详情。包括群名、群成员列表、群成员入群时间、入群方式。（客户群是由具有客户群使用权限的成员创建的外部群）<para/>
        // /// 需注意的是，如果发生群信息变动，会立即收到群变更事件，但是部分信息是异步处理，可能需要等一段时间调此接口才能得到最新结果<para/>
        // /// <see url="https://developer.work.weixin.qq.com/document/path/92122"/>
        // /// </summary>
        // /// <param name="access_token">调用接口凭证</param>
        // /// <param name="input"></param>
        // /// <returns></returns>
        // [HttpPost("externalcontact/groupchat/get")]
        // Task<ChatDetailApiResult> GetAsync([Required] string access_token, [JsonNetContent(CharSet = "utf-8")] QueryChatDetailInput input);
        /// <summary>
        /// 获取客户群详情<para/>
        /// 
        /// 通过客户群ID，获取详情。包括群名、群成员列表、群成员入群时间、入群方式。（客户群是由具有客户群使用权限的成员创建的外部群）<para/>
        /// 需注意的是，如果发生群信息变动，会立即收到群变更事件，但是部分信息是异步处理，可能需要等一段时间调此接口才能得到最新结果<para/>
        /// <see url="https://developer.work.weixin.qq.com/document/path/92122"/>
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("externalcontact/groupchat/get")]
        Task<ChatDetailApiResult> GetAsync([JsonNetContent(CharSet = "utf-8")] QueryChatDetailInput input);
        // /// <summary>
        // /// 客户群opengid转换
        // /// <see url="https://developer.work.weixin.qq.com/document/path/94822"/>
        // /// </summary>
        // /// <param name="access_token"></param>
        // /// <param name="input"></param>
        // /// <returns></returns>
        // [HttpPost("externalcontact/opengid_to_chatid")]
        // Task<ChatApiResult> OpenIdToChatIdAsync([Required] string access_token, [JsonNetContent(CharSet = "utf-8")] OpenIdToChatIdInput input);
        /// <summary>
        /// 客户群opengid转换
        /// <see url="https://developer.work.weixin.qq.com/document/path/94822"/>
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("externalcontact/opengid_to_chatid")]
        Task<ChatApiResult> OpenIdToChatIdAsync([JsonNetContent(CharSet = "utf-8")] OpenIdToChatIdInput input);
    }
}
